#! /bin/bash
server_array=(31 32 33 35 36 37)
ipadd=192.168.2
for server in ${server_array[*]}
do
echo "ssh to $server >>>"
ssh -Tq ubuntu@$ipadd.$server >/dev/null <<rmssh
cd /tmp
echo yedpay | sudo -S bash -c "echo 'ClientAliveInterval 60'>> /etc/ssh/sshd_config"
echo yedpay | sudo -S bash -c "echo 'ClientAliveCountMax 3'>> /etc/ssh/sshd_config"
echo yedpay | sudo -S /etc/init.d/ssh restart
rmssh
done
